package sigl.exporter;

import sigl.model.Model;

/**
 *
 * @author uxmal
 */
public class Main {

    public static int main(String[] args) {

        String inputFile  = null, 
               mode       = null,
               outputFile = null;
        
        if (args.length > 2) {
            inputFile  = args[0];
            mode       = args[1];
            outputFile = args[2];
        }
        else {
            System.out.println("Arguments: entree.yml (-m|-p) sortie.gdf");
            return 1;
        }

        // creation du projet
        System.out.println(" - Chargement du modèle..");
        Model cpan = new Model(inputFile);
        
        // export au format GDF
        System.out.println(" - Export au format GDF..");
        GDF exporter = new GDF(cpan);
        if (mode.equals("-m")) {
            exporter.exportModules(outputFile);

        } else if (mode.equals("-p")) {
            exporter.exportPackages(outputFile, true);
        }
    return 0;
    }
    
}
